<?php if (!defined("_ECRIRE_INC_VERSION")) return; if (class_exists('RubriqueCurrencyModel')) return;
/**
 * EcataloguE
 *
 * @author     Aleksey Yaroshchuk (aleksey.yaroshchuk@gmail.com)
 * @license    GNU/GPL
 * @package    plugins
 * @subpackage ecatalogue
 * @copyright  (c) Aleksey Yaroshchuk 2011-2012
 * @link       http://www.spip-contrib.net/EcataloguE
 */

/**
 *  RubriqueCurrencyModel class 
 *
 *  @author Aleksey Yaroshchuk (aleksey.yaroshchuk@gmail.com) 
 */
include_spip('classes/pdk_model'); 
class RubriqueCurrencyModel extends pdk_Model {   
    
    public function __construct() {
        parent::__construct();
        $this->config_model();
    }
    
    function config_model() {
        // Define main table:
        $this->main_table = 'spip_ecatalogue_rubriques_currencies';
        
        // Define primary key:
        $this->primary_key = 'id_rubrique';
        
        // Define main table fields:
        $this->main_fields['id_rubrique'] = 'id_rubrique';
        $this->main_fields['id_currency'] = 'id_currency';
                                                                                 
         // Define validation rules:
         $this->validation->set_rules( 
            array(
                array(
                     'field'   => 'id_rubrique',
                     'label'   => 'ID rubrique',
                     'rules'   => 'required'
                  ),  
                array(
                     'field'   => 'id_currency',
                     'label'   => 'ID currency',
                     'rules'   => 'required'
                  )
            )
         );                                       
    }
    
    // Define test data
    public $test_data = array(
        array('id_rubrique'=>1,'id_currency'=>1),
        array('id_rubrique'=>2,'id_currency'=>2),
        array('id_rubrique'=>3,'id_currency'=>3),
    );
} 
?>